package tw.com.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class KeyNames {

	private static Properties props;

	public static void init() {
		loadPropsFile();
	}

	public static String get(String key) {
		String value = null;
		if (props.containsKey(key)) {
			value = (String) props.get(key);
		} else {
			value = key;
		}
		return value;
	}

	private static void loadPropsFile() {
		props = new Properties();
		try {
			props.load(Thread.currentThread().getContextClassLoader()
					.getResourceAsStream("keynames.properties"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
